
<div class="view-items">

        <?php $user = User::model()->findByPk($data->distributor_id); ?>
<div class="distributor-detail">
    <div class="price-cart">
        <div class="price"><?php echo number_format($data->unit_price) ?> <span> vnđ</span></div>
            <div class="add-to-cart" onclick="
             $.post( '<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=shop/shop/addToCart',               
                    { 'distributor': <?php echo $user->id; ?>, 
                      'product_id' : <?php echo $data->product_id ?>, 
                      'amount' : 1
                    }
                )
                .success(function(){ alert('Đã cho vào giỏ hàng của bạn !');});    
             " distributor="<?php echo $user->id; ?>" product="<?php echo $data->product_id ?> ">Đặt hàng</div>
    </div>
    <div class="desc">
        <p class="distributor-name"><a href="">
        <?php echo $user->full_name; ?></a>
            dai ly cua 
        <a href=""><?php echo User::model()->findByPk($data->supplier_id)->full_name; ?></a></p>
        
        <p class="address"><?php echo $user->address.' - '.Yii::app()->getModule('user')->provinceArr[$user->province]; ?></p>
    </div>
    
    
</div>
        
    </div>


